package algotithm.acwing.packageproblem.test1371;

/**
 * @author zhouyanxiang
 * @Date 2021-01-2021/1/25-16:05
 */
import java.io.*;
import java.util.Scanner;

public class Main{

    private static int M = 100010;
    private static long[] f = new long[M];


    public static void main(String[] args) throws IOException{
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int[] arr = new int[n+1];
        for (int i = 1; i <= n; i++) {
            arr[i] = scanner.nextInt();
        }

        f[0] = 1;
        for (int i = 1; i <= n; i++) {
            for (int j = arr[i]; j <= m; j++) {
                f[j] = f[j] + f[j - arr[i]];
            }
        }
        System.out.println(f[m]);

    }

}